<template>


  <el-container class="index-con">
    <el-aside :class="showclass">
      <leftnav></leftnav>
    </el-aside>
    <el-container class="main-con">
      
      <el-main clss="index-main">
        <!-- <el-breadcrumb separator-class="el-icon-arrow-right">
          <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
          <el-breadcrumb-item :to="{ path: this.$route.path }">{{ this.$route.name }}</el-breadcrumb-item>
          <el-breadcrumb-item></el-breadcrumb-item>
        </el-breadcrumb> -->
        <div class="admin-header">
          <h3>{{ this.$route.name }}</h3>
          <p>Admin <img src="../assets/img/logo.png" alt=""></p>
        </div>
        <router-view></router-view>
        
      </el-main>
    </el-container>
  </el-container>
</template>
<script>
// 导入组件
import navcon from '../components/navcon.vue'
import leftnav from '../components/leftnav.vue'
export default {
  name: 'index',
  data() {
    return {
      showclass: 'asideshow',
      showtype: false,
      showcode:true
    }
  },
  // 注册组件
  components: {
    navcon,
    leftnav
  },
  methods: {},
  created() {
    console.log(this.$route)
    console.log('this.$route')
    // if(this.$route.fullPath.indexOf('code=') > -1){
    //   this.showcode = false
    // }else{
    //   this.showcode = true
    // }
    // 监听
    this.$root.Bus.$on('toggle', value => {
      if (value) {
        this.showclass = 'asideshow'
      } else {
        setTimeout(() => {
          this.showclass = 'aside'
        }, 300)
      }
    })
  },
  beforeUpdate() {},
  // 挂载前状态(里面是操作)
  beforeMount() {
    // 弹出登录成功
    this.$message({
      message: '登录成功',
      type: 'success'
    })
  }
}
</script>
<style >
.is-link{
  cursor: pointer !important;
}
.index-con {
  height: 100%;
  width: 100%;
  box-sizing: border-box;
}

.aside {
  width: 64px !important;
  height: 100%;
  background-color: #1C1E22;
  margin: 0px;
}
.asideshow {
  height: 100%;
  background-color: #1C1E22;
  margin: 0px;
}
.index-header,
.index-main {
  padding: 0px;
  border-left: 2px solid #333;
}

.admin-header{
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding:0 20px 40px 20px;
  height: 40px;
  color: #1C1E22;
}
.admin-header p{display: flex;align-items: center;font-weight: bold;}
.admin-header h3{
  border-left: 3px solid #1C1E22;
  padding-left: 20px;
  line-height: 20px;
}
.admin-header img{width: 24px;padding-left: 10px;}
</style>
